<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./adminTemplate.xhtml">

            <ui:define name="title">
                Welcome !
            </ui:define>

            <ui:define name="contain">

                <h:form> 
                    <h2 class="ico_mug">Dashboard</h2>
                    <div class="clearfix">
                        <div class="left quickview">
                            <h3>Overview</h3>
                            <ul>
                                <li style="color: #0071bc">Total Company <span class="number" style="color: red">#{statisticController.totalCompany}</span></li>
                                <li style="color: #0071bc">Total denied company: <span class="number" style="color: red">#{statisticController.totalCompDisable}</span></li>
                                <li style="color: #0071bc">Total accepted company: <span class="number" style="color: red">#{statisticController.totalCompEnable}</span></li>
                                <li style="color: #0071bc">Total Driver <span class="number" style="color: red">#{statisticController.totalDriver}</span></li>
                                <li style="color: #0071bc">Total denied driver: <span class="number" style="color: red">#{statisticController.totalDriverDisable}</span></li>
                                <li style="color: #0071bc">Total accepted driver: <span class="number" style="color: red">#{statisticController.totalDriverEnable}</span></li>
                            </ul>
                        </div>
                        <div class="quickview left">
                            <h3>Some data</h3>
                            <ul>
                                <li style="color: #0071bc">Total Advertise <span class="number" style="color: red">#{statisticController.totalAdvertise}</span></li>
                                <li style="color: #0071bc">Total Feedback <span class="number" style="color: red">#{statisticController.totalFeedback}</span></li>
                                <li style="color: #0071bc">Total Banner <span class="number" style="color: red">#{statisticController.totalBanner}</span></li>
                                <li style="color: #0071bc">Total Payment <span class="number" style="color: red">#{statisticController.totalPayment}</span></li>
                                <li style="color: #0071bc">Total Paid <span class="number" style="color: red">#{statisticController.totalPaid}</span></li>
                                <li style="color: #0071bc">Total Unpaid <span class="number" style="color: red">#{statisticController.totalUnpaid}</span></li>
                            </ul>
                        </div>
                    </div>


                    <h2 class="ico_mug">Register Request from Company</h2>  
                    <p:dataTable var="lrt" value="#{requestController.listCom}">                               
                        <p:column>  
                            <f:facet name="header">  
                                Name 
                            </f:facet>  
                            <h:outputText value="#{lrt.name}" />  
                        </p:column>                              
                        <p:column>  
                            <f:facet name="header">  
                                Contact
                            </f:facet>  
                            <h:outputText value="#{lrt.contactPerson}" />  
                        </p:column>
                        <p:column>  
                            <f:facet name="header">  
                                Designation  
                            </f:facet>  
                            <h:outputText value="#{lrt.designation}"/>
                        </p:column>
                        <p:column>  
                            <f:facet name="header">  
                                Address  
                            </f:facet>  
                            <h:outputText value="#{lrt.address}"/>
                        </p:column>
                        <p:column>  
                            <f:facet name="header">  
                                Mobile  
                            </f:facet>  
                            <h:outputText value="#{lrt.mobile}"/>
                        </p:column>
                        <p:column>  
                            <f:facet name="header">  
                                Telephone 
                            </f:facet>  
                            <h:outputText value="#{lrt.telephone}" />  
                        </p:column> 
                        <p:column>  
                            <f:facet name="header">  
                                MemberType  
                            </f:facet>  
                            <h:outputText value="#{lrt.memberType}"/>
                        </p:column> 
                        <p:column style="text-align: center;vertical-align: middle">  
                            <f:facet name="header">  
                                Approve  
                            </f:facet>  
                            <h:commandLink actionListener="#{requestController.updateAcceptLt(lrt.id)}">
                                <img src="img/accept.jpg" alt="accepted"/>
                            </h:commandLink>
                            <h:commandLink actionListener="#{requestController.updateDenyLt(lrt.id)}">
                                <img src="img/denied.png" alt="cancel"/>
                            </h:commandLink>
                        </p:column> 
                    </p:dataTable>   
                    <br/><br/>
                    <h2 class="ico_mug">Register Request from Driver</h2>
                    <p:dataTable var="dr" value="#{requestController.listDr}"> 
                        <p:column>  
                            <f:facet name="header">  
                                Name Driver  
                            </f:facet>  
                            <h:outputText value="#{dr.name}" />  
                        </p:column> 
                        <p:column>  
                            <f:facet name="header">  
                                ContactPerson  
                            </f:facet>  
                            <h:outputText value="#{dr.contactPerson}"/>
                        </p:column> 
                        <p:column>  
                            <f:facet name="header">  
                                Address  
                            </f:facet>  
                            <h:outputText value="#{dr.address}" />  
                        </p:column> 
                        <p:column>  
                            <f:facet name="header">  
                                City  
                            </f:facet>  
                            <h:outputText value="#{dr.city}"/>
                        </p:column>
                        <p:column>  
                            <f:facet name="header">  
                                Mobile 
                            </f:facet>  
                            <h:outputText value="#{dr.mobile}" />  
                        </p:column> 
                        <p:column>  
                            <f:facet name="header">  
                                Telephone
                            </f:facet>  
                            <h:outputText value="#{dr.telephone}" />  
                        </p:column> 
                        <p:column>  
                            <f:facet name="header">  
                                Experience  
                            </f:facet>  
                            <h:outputText value="#{dr.experience}" />  
                        </p:column> 
                        <p:column>  
                            <f:facet name="header">  
                                Description  
                            </f:facet>  
                            <h:outputText value="#{dr.description}" />  
                        </p:column> 
                        <p:column style="text-align: center;vertical-align: middle">  
                            <f:facet name="header">  
                                Approve  
                            </f:facet>  
                            <h:commandLink actionListener="#{requestController.updateAcceptDr(dr.id)}">
                                <img src="img/accept.jpg" alt="accepted"/>
                            </h:commandLink>
                            <h:commandLink actionListener="#{requestController.updateDenyDr(dr.id)}">
                                <img src="img/denied.png" alt="cancel"/>
                            </h:commandLink>
                        </p:column> 

                    </p:dataTable>      
                </h:form>

            </ui:define>

        </ui:composition>

    </body>
</html>
